package com.myproject.mall.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.myproject.mall.domain.enums.UserRole;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@TableName("scmall_user")
@Schema(description = "用户")
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class User {
    @Schema(description = "用户ID")
    @TableId(value = "user_id", type = IdType.ASSIGN_ID)
    private String id;

    @Schema(description = "用户名")
    @TableField(value = "user_username")
    private String username;

    @Schema(description = "用户手机")
    @TableField(value = "user_phone")
    private String phone;

    @Schema(description = "用户密码")
    @TableField(value = "user_password")
    private String password;

    @Schema(description = "用户简介")
    @TableField(value = "user_description")
    private String description;

    @Schema(description = "用户角色")
    @TableField(value = "user_role")
    private UserRole role;

    @Schema(description = "用户头像")
    @TableField(value = "user_icon")
    private String icon;

    @Schema(description = "用户地址")
    @TableField(value = "user_address")
    private String address;

    @Schema(description = "用户创建时间")
    @TableField(value = "user_create_time")
    private LocalDateTime createTime;

    @Schema(description = "用户更新时间")
    @TableField(value = "user_update_time")
    private LocalDateTime updateTime;
}
